Allow Hint Space Ids for NativeSumcheck Inputs#31
Open
darth-cy wants to merge 9 commits intofeat/v1.4.1-scroll-extfrom
Open
Allow Hint Space Ids for NativeSumcheck Inputs#31darth-cy wants to merge 9 commits intofeat/v1.4.1-scroll-extfrom
NativeSumcheck Inputs#31darth-cy wants to merge 9 commits intofeat/v1.4.1-scroll-extfrom
Conversation
kunxian-xia
reviewed
Feb 3, 2026
| /// write p_evals | ||
| pub write_record: MemoryWriteAuxCols<T, EXT_DEG>, | ||
| /// write p1, p2 values back to witness array if the source is hint space id | ||
| pub write_ps_record: MemoryWriteAuxCols<T, { EXT_DEG * 2 }>, |
There was a problem hiding this comment.
since we already have write_ps_record, let's remove the above read_records.
| /// write both p_evals and q_evals | ||
| pub write_records: [MemoryWriteAuxCols<T, EXT_DEG>; 2], | ||
| /// write p1, p2, q1, q2 back to witness array if the source is hint space id | ||
| pub write_pqs_record: MemoryWriteAuxCols<T, { EXT_DEG * 4 }>, |
Comment on lines
394
to
404
| self.memory_bridge | ||
| .read( | ||
| MemoryAddress::new(native_as, register_ptrs[2] + prod_row_specific.data_ptr), | ||
| prod_row_specific.p, | ||
| start_timestamp, | ||
| &prod_row_specific.read_records[0], | ||
| ) | ||
| .eval( | ||
| builder, | ||
| (prod_in_round_evaluation + prod_next_round_evaluation) * not(is_hint_src_id), | ||
| ); |
There was a problem hiding this comment.
opt: we can mimic the memory read behavior by reusing write_ps_record with one additional requirement that write_ps_record.prev_data == prod_row_specific.p if it's not(is_hint_src_id).
Comment on lines
496
to
506
| self.memory_bridge | ||
| .read( | ||
| MemoryAddress::new(native_as, register_ptrs[3] + logup_row_specific.data_ptr), | ||
| logup_row_specific.pq, | ||
| start_timestamp, | ||
| &logup_row_specific.read_records[0], | ||
| ) | ||
| .eval( | ||
| builder, | ||
| (logup_in_round_evaluation + logup_next_round_evaluation) * not(is_hint_src_id), | ||
| ); |
kunxian-xia
reviewed
Feb 3, 2026
| let num_prod_evals = num_prod_specs * num_layers * 2; | ||
| let prod_spec_evals: Array<C, Ext<C::F, C::EF>> = builder.dyn_array(num_prod_evals); | ||
| for idx in 0..num_prod_evals { | ||
| let e: Ext<C::F, C::EF> = builder.constant(prod_evals[idx]); |
There was a problem hiding this comment.
You restored the original test back, it's better to add one more test case to cover the case that evals comes from hint space.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NativeSumcheckopcode's ability to accept hint space Ids for its evaluation inputs.prod_evalsandlogup_evalsfrom hint insumcheck_layer_eval#30, this PR ensures the read values are written back to default-initialized witness arrays if the evaluations come from hint space.